package com.swf.seed.security.cert;

public abstract class SecuritySigner {
	/**
	 * 
	 * @param b
	 * @return
	 */
	public static String byteArrayToHexString(byte b[]) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < b.length; i++)
			sb.append(byteToHexString(b[i]));
		return sb.toString();
	}
	
	/**
	 * 转换字节为16进制字符串
	 * @param b
	 * @return
	 */
	public static String byteToHexString(byte b) {
		int n = b;
		if (n < 0){
			n += 256;
		}
		String hexString = Integer.toHexString(n);
		return hexString.length()==2?hexString:"0"+hexString;
	}
}
